
\subsubsection{Mathematical model}
Objective:
\begin{equation}
\max{z}
\end{equation}

Constraints:
\begin{align}
&0\le P_g \le 1 \\
&\forall_{i \in I}{x_i\ge 0} \\
&\forall_{i \in I}{c_i\ge 0} \\
&\forall_{i \in I}{y_i = x_i + c_i} \\
&\sum_{i \in I}{x_i} = G \\
&\forall_{i \in I}{u_i = c_i + \alpha_i \cdot G} \\
&\forall_{i \in I}{z = \frac{c_i+\alpha_i\cdot P_g \cdot G}{y_i+\alpha_i\cdot G}}
\end{align}

\subsubsection{AMPL model}

\begin{lstlisting}[language=c,style=outcode,caption=ks.model.ampl]
################# PARAMETERS
param N;                     # number of the agents
param G;                     # cost of the good
param alpha{1..10} >=0, <=1; # MRS
param y{1..10} >=0;          # endowment
################# VARIABLES
var x{1..N} >=0;             # contribution/tax
var u{1..N};                 # utility
var c{1..N} >=0;             # private constumption
var z >=0;                   # auxiliary variable
var Pg >= 0, <=1;            # scale of good provision
################# CONSTRAINTS
subject to util {i in 1..N}:
	u[i] = c[i] + alpha[i] * Pg * G;
subject to provide_good:
	sum{i in 1..N} x[i] = Pg * G;
subject to budgets {i in 1..N}:
	y[i] = x[i] + c[i];
subject to z_ks{i in 1..N}:
	(c[i] + alpha[i] * Pg * G)/(y[i] + alpha[i] * G) = z;
################# OBJECTIVE
maximize ks:
	z;
\end{lstlisting}

\subsubsection{Results}
\begin{lstlisting}[language=c,style=outcode,caption=Kalai-Smorodinsky results for scenario A]
DONLP2: Success! KKT conditions satisfied
F = 0.9353179469
41 iters; 52 function, 17 gradient evals
4866 component constraint, 31 grad evals
final objective scaling = 100.05
norm(grad(f)) = 1, Lagrangian violation = 9.56416e-17
feas. violation = 1.35836e-13, dual feas. violation = 0
###### K-S ####### z = 0.94 ### Pg = 1.00 ###
\end{lstlisting}


\begin{table}[H]
\caption{Kalai-Smorodinsky results for scenario A}
\begin{center}
\begin{tabular}{|r||r|r|r|r|r|}
\hline
$i$ & $\alpha_i$ & $y_i$ & $x_i$ & $c_i$ & $u_i$ \\
\hline 
1&0.55&91.15&9.43&81.72   &136.42\\
2&0.75&121.29&12.71&108.58&183.77\\
3&0.54&100.49&10.00&90.50 &144.56\\
4&0.23&93.48&7.56&85.92   &109.35\\
5&0.43&107.64&9.74&97.91  &140.78\\
6&0.56&127.22&11.84&115.38&171.25\\
7&0.72&98.34&11.02&87.32  &159.35\\
8&0.67&74.08&9.14&64.93   &132.20\\
9&0.47&85.57&8.56&77.01   &123.80\\
10&0.54&100.62&10.00&90.62&144.56\\
\hline
\end{tabular}
\end{center}
\label{tab:kala_res_A}
\end{table}


